package com.rytong.tools.ui;

import java.util.ArrayList;
import java.util.HashMap;


public class ComponentCopy {
    // xml中单个节点子元素集合
    public ArrayList nodeChildren_;
    // xml中属性集合
    public HashMap nodeAttrsMap_;
    // 节点名
    public String nodeName_;
    // 节点值
    public String nodeValue_;

    public static ComponentCopy CC;
    // 界面控件结构集合
    public static Component COMPONENT;
    // 界面局部控件集合，主要用于局部控件更新
    public static Component COMPONENTPARTLY;

    public ComponentCopy() {
        nodeChildren_ = new ArrayList(2);
        nodeAttrsMap_ = new HashMap(5);
    }

    public void setName(String name) {
        nodeName_ = name;
    }

    public void setValue(String value) {
        nodeValue_ = value;
    }

    public void addAttrs(String key, String value) {
        nodeAttrsMap_.put(key, value);
    }

    public void addChilds(Object o) {
        nodeChildren_.add(o);
    }

    public String getName() {
        return nodeName_;
    }

    public String getValue() {
        return nodeValue_;
    }

    public Object getAttrs() {
        return nodeAttrsMap_;
    }

    public Object getAttr(String name) {
        return nodeAttrsMap_.get(name);
    }

    public ArrayList getChildren() {
        return nodeChildren_;
    }

    public ComponentCopy getChild(int index) {
        return (ComponentCopy) nodeChildren_.get(index);
    }
}
